package com.itheima.mall.service.umsService;

import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class UmsRoleResourceRelationService {

    @DubboReference
    private UmsRoleResourceRelationApi umsRoleResourceRelationApi;

    /**
     * 给角色分配资源
     * @param resourceIds 资源ID数组
     * @param roleId 角色ID
     * @return
     */
    public void allocResource(ArrayList<Long> resourceIds, Long roleId) {
        umsRoleResourceRelationApi.allocResource(resourceIds,roleId);
    }

    /**
     * 根据角色ID查询关联资源IDS数组
     * @param roleId 角色ID
     * @return
     */
    public ArrayList<Long> getresourceIds(long roleId) {
        return umsRoleResourceRelationApi.getresourceIds(roleId);
    }
}
